﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;

namespace LiteBlog.Common.Entities
{
    public class Page
    {
        [Required(ErrorMessage = "Please enter url name")]
        [RegularExpression(@"^[\S]*$", ErrorMessage = "The url name cannot contain white spaces")]
        public string FileId { get; set; }

        [Required(ErrorMessage = "Please enter display name")]
        [RegularExpression(@"[\w-\?!:,\. ]+", ErrorMessage = "No special characters allowed in the title")]
        public string Title { get; set; }

        public string Body { get; set; }
        public bool Published { get; set; }
        public bool IncludeInHeaderMenu { get; set; }

        public Page()
        {
            FileId = Title = Body = string.Empty;
            Published = false;
            IncludeInHeaderMenu = true;
        }
    }
}
